

//
//  UserAgreementViewController.m
//  LuxuryGoods
//
//  Created by DCQ on 2018/5/25.
//  Copyright © 2018年 Future. All rights reserved.
//

#import "UserAgreementViewController.h"

@interface UserAgreementViewController ()
@property(strong, nonatomic)UIWebView * webView;
@end

@implementation UserAgreementViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    [self setNavigationItemTitle:@"用户协议"];
    [self.view addSubview:self.webView];
    self.webView.scrollView.bounces = NO;
    self.webView.backgroundColor = [UIColor whiteColor];
    if (@available(iOS 11.0, *)) {
        self.webView.scrollView.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever;
    } else {
            // Fallback on earlier versions
    }
    [self.webView mas_updateConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(self.view.mas_left);
        make.right.mas_equalTo(self.view.mas_right);
        make.top.mas_equalTo(self.view.mas_top);
        make.bottom.mas_equalTo(self.view.mas_bottom);
    }];
}
- (BOOL)getLayoutIncludesOpaqueBars{
    
    return YES;
}
- (UIRectEdge)getViewRect{
    return UIRectEdgeAll;
}
- (void)getNetworkData{
    
    NSDictionary * params =nil;
    
    [[MainApi sharedInstance] postPath:@"Common/getYhxy" params:params resultBlock:^(NSDictionary *responseObject, NSError *error) {
        if (!error) {
            
           NSString * htmlData = responseObject[@"data"];
            [self.webView loadHTMLString:htmlData baseURL:[NSURL URLWithString:@"http:www.baidu.com"]];
        }
        
    }];
}

- (void)loadWebView:(NSString *)url{
    NSURL * webUrl = [NSURL URLWithString:url];
    [self.webView loadRequest:[NSURLRequest requestWithURL:webUrl]];
}

- (UIWebView *)webView{
    if (!_webView) {
        _webView = [[UIWebView alloc]initWithFrame:CGRectMake(0, 0, self.view.frame.size.width, self.view.frame.size.height)];
        
    }
    return _webView;
}
- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
